#include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;

int n = 0;
int a[1024][1024];

static void Init() {
    for (int i = 0; i < 1024; ++i)
        for (int j = 0; j < 1024; ++j)
            a[i][j] = 0;
}

static void Solve() {
    a[0][0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int j = i; j < n; ++j) {
            a[i][j+1] += a[i][j];
            if (i != j)
                a[i+1][j] += a[i][j];
        }
    }
}

static void ShowA() {
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            cout << a[i][j] << "\t";
        }
        cout << endl;
    }
}

int main() {
    cout << "Enter n: " << endl;
    cin >> n;
    ++n;
    Init();
    Solve();
    ShowA();
    cout << "Result: " << a[n-1][n-1] << endl;
    return 0;
}
